<?php

namespace Services\Log\Models;

use Admin\Models\BaseModel;

class XhlogWechat extends BaseModel
{

    /**
     *
     * @var integer
     * @Primary
     * @Identity
     * @Column(type="integer", length=11, nullable=false)
     */
    public $id;

    /**
     *
     * @var string
     * @Column(type="integer", nullable=true)
     */
    public $sendTime;

    /**
     *
     * @var string
     * @Column(type="string", nullable=true)
     */
    public $content;

    /**
     *
     * @var integer
     * @Column(type="integer", length=4, nullable=true)
     * 1=文字，2=图片，3=音频，4=视频
     */
    public $type;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $senderAccount;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $senderName;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $senderMark;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $receiverAccount;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $receiverName;

    /**
     *
     * @var string
     * @Column(type="string", length=255, nullable=true)
     */
    public $receiverMark;

    /**
     * Initialize method for model.
     */
    public function initialize()
    {
        parent::initialize();
    }

    public function columnMap()
    {
        return [
            'iWCId'             => 'id',
            'iSendTime'         => 'sendTime',
            'mContent'          => 'content',
            'iType'             => 'type',
            'sSenderAccount'    => 'senderAccount',
            'sSenderName'       => 'senderName',
            'sSenderMark'       => 'senderMark',
            'sReceiverAccount'  => 'receiverAccount',
            'sReceiverName'     => 'receiverName',
            'sReceiverMark'     => 'receiverMark',
        ];
    }

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'XHLog_WeChat';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return XhlogWechat[]|XhlogWechat
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return XhlogWechat
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

}
